import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/view/home/home'
import introduction from '@/view/introduction/introduction'
import about from '@/view/introduction/about'
import introduce from '@/view/introduction/introduce'
import product from '@/view/product/product'
import info from '@/view/product/info'
import programme from '@/view/product/programme'
import share from '@/view/share/share'
import infos from '@/view/share/info'
import down from '@/view/share/down'
import sign from '@/view/login/sign'
import downs from '@/view/down/downs'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home,
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: Home
    },
    {
      path: '/downs',
      name: 'downs',
      component: downs,
      meta: {auth: true}
    },
    {
      path: '/sign',
      name: 'sign',
      component: sign
    },
    {
      path: '/share',
      name: 'share',
      component: share,
      redirect: '/share/info',
      children: [
        {
          path: '/share/info',
          name: 'info',
          component: infos
        },
        {
          path: '/share/down',
          name: 'down',
          component: down
        }
      ]
    },
    {
      path: '/product',
      name: 'product',
      component: product,
      redirect: '/product/info',
      children: [
        {
          path: '/product/info',
          name: 'info',
          component: info
        },
        {
          path: '/product/programme',
          name: 'programme',
          component: programme
        }
      ]
    },
    {
      path: '/introduction',
      name: 'introduction',
      component: introduction,
      redirect: '/introduction/about',
      children: [
        {
          path: '/introduction/about',
          name: 'about',
          component: about
        },
        {
          path: '/introduction/introduce',
          name: 'introduce',
          component: introduce
        }
      ]
    }
  ]
})

